package org.leiyang.service.impl;

import org.leiyang.common.dtos.TestRequestVO;
import org.leiyang.service.TestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.time.Duration;

@Service
public class TestServiceImpl implements TestService {
    private static final Logger log = LoggerFactory.getLogger(TestServiceImpl.class);
    @Override
    public String showOneInfo(String info) {
        return "Show your info: ".concat(info);
    }

    @Override
    public Mono<String> syncShowOneInfo(String info) {
        return Mono.just("Show your sync info: ".concat(info));
    }

    @Override
    public Flux<String> listNames(TestRequestVO requestVO) {
        return Flux.just(requestVO.getRegisterName(),"o1","o2","o3").delayElements(Duration.ofSeconds(1));
//        throw new RuntimeException("异常..");
    }

    public static class UserService {
    }
}
